home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 5468 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: mserv.wizvax.net!news
  2. From: tonyp@wizvax.wizvax.net (Tony Postmayer)
  3. Newsgroups: comp.sys.cbm
  4. Subject: Re: programming question:block-X commands
  5. Date: Sat, 13 Apr 1996 00:22:23 GMT
  6. Organization: Wizvax Communications, Troy, N.Y. 12180 USA
  7. Message-ID: <316ef311.308129@199.181.141.3>
  8. References: <4k3joe$5st@news.xmission.com>
  9. NNTP-Posting-Host: tonyp.wizvax.net
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. On 5 Apr 1996 17:03:10 GMT, jshell@xmission.com (riverYard) wrote:
  13.  
  14. >i asked this earlier but i lost the answer, and it didn't help much 
  15.  
  16. Not the best tone to set if you expect help.
  17.  
  18. >anyhooz.  i was told that to use the U1 and U2 drive commands through 
  19. >assembly, you had to send the whole thing as a big block of text, i.e.:
  20. >.byte "U1: 2 0 18 1" for channel, drive, track, block respectively.  i 
  21. >don't have a number-to-text routing written yet and i don't want to deal 
  22. >with it right now.  can i send
  23. >.byte "U1:",2,0,18,1 instead?  last time i tried this and it didn't work, 
  24. >but i was using B-R instead.  
  25. >
  26. Like I told you before, the commands must be sent as TEXT.
  27.  
  28. See if you can manage to utilize this:
  29.  
  30.        ;===========================
  31.        ;== convert 16 bit number ==
  32.        ;== to ascii text         ==
  33.        ;== enter with number x/a ==
  34.        ;===========================
  35.      baws *=*+3 ;workspace
  36.        ;
  37.      bin2asc =*
  38.        sta baws+1 ;high byte
  39.        stx baws+2 ;low byte
  40.        lda #0
  41.        pha        ;flag
  42.      bin2asc0 =*
  43.        ldx #16
  44.        lda #0
  45.        clc
  46.      bin2asc1 =*
  47.        sta baws
  48.      bin2asc2 =*
  49.        rol baws+2
  50.        rol baws+1
  51.        rol baws
  52.        dex
  53.        bmi bin2asc3
  54.        lda baws
  55.        cmp #10    ;remainder >9
  56.        bcc bin2asc2
  57.        sbc #10
  58.        bcs bin2asc1
  59.      bin2asc3 =*
  60.        ora #$30
  61.        pha
  62.        lda baws+2
  63.        ora baws+1
  64.        bne bin2asc0
  65.      bin2asc4 =*
  66.        pla
  67.        beq bin2asc5
  68.        jsr $ffd2
  69.        bne bin2asc4
  70.      bin2asc5 =*
  71.        rts
  72.  
  73.